import {getExcPortConfig} from "@/api/pm/excPortConfig";

export default {
  name() {
    return {
      // 修改字段
      updateField: {
        open: false,
        title: '修改字段'
      },

      // 修改字段的内容
      updateForm: [],
    }
  },
  methods: {

    handleFiledUpdate(row) {

      this.reset();
      const id = row.id || this.ids
      getExcPortConfig(id).then(response => {
        this.updateForm = response.data;

        this.updateField.open = true;
        this.updateField.title = "修改接口参数配置";
      });
    },

    /**
     * 修改字段的回调
     * @param res
     */
    updateFieldForm(res) {
      if (res.code == 200) {
        this.$message.success(res.msg);
      } else {
        this.$message.error(res.msg);
      }

      this.getList();
      this.updateField.open = false;
    },

    // 取消操作
    cancelFieldForm(res) {
      this.updateField.open = res;
    },
  }
}
